<?php
#收藏任务后端
require_once("PHPMySQLiDatabaseClass/MysqliDb.php");
require_once("db_config.php");
$db_config = new dbConfig();
$db = new MysqliDb(
    $db_config->host,
    $db_config->account,
    $db_config->pwd,
    'student');
$task_name = $_POST['task_name'];
$price     = $_POST['price'];
$type      = $_POST['type'];
$collecter = $_POST['collecter'];
$end_time  = $_POST['end_time'];
$collect_time = date("Y-m-d");//年月日
$data = Array
(
    //'id'       => 1,
    'task_name'=> $task_name,
    "price"    => $price,
    "type"     => $type,
    "collect_time"=>$collect_time,
    "end_time"=>$end_time,
    "collecter"=> $collecter
);
$id = $db->insert("collect",$data);
if($id)
{
    echo "插入成功";
}
else
{
    echo "插入失败".$db->getLastError();
    //echo $price;
}
//$dbUtils = new dbUtils();
//$dbUtils->insert_row($db,"task_name",$task_name,"collect",$data,false);
?>